Archive a employee

This request is used to archive a client's employee. When archived, the employee disappears from the account profile. The employee can't use the services and can't be found in the account profile.

If you try to create an employee with the same phone number as the archived employee, an error will occur. In this case, instead of creating a new employee, you must restore the employee from the archive with updated data.

Note

We strongly recommend not changing the employee's phone number. Instead, create a new employee.

Request syntax

POST https://b2b-api.go.yandex.ru/integration/2.0/users/archive?user_id={user_id}

Request headers

  • Authorization: Bearer <OAuth-token>
    OAuth access token. The steps to get a token are described in Getting started.
  • X-YaTaxi-Selected-Corp-Client-Id — client ID from the account. Required if multiple clients are available using the token.

Request parameters

The request contains the following required parameter:

  • user_id — employee's ID.

Response field description

The response contains the following fields:

Field Description Format
status The request status. String

Request example

POST https://b2b-api.go.yandex.ru/integration/2.0/users/archive?user_id=f65...c57d
...
Authorization: Bearer <OAuth token>

Response example

An example response to this request looks like this:

{
    "status": "OK"
}

Response codes

The response to this request may contain the following standard HTTP codes:

  • 200: Request completed successfully.
  • 401: The OAuth token is incorrect.
  • 403: The client doesn't have sufficient rights to run this request.
    • SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header X-YaTaxi-Selected-Corp-Client-Id (returned if more than one client is available for the token).
    • SELECTED_CLIENT_ACCESS_DENIED: the header X-YaTaxi-Selected-Corp-Client-Id contains the client's ID, which this login does not have access to.
  • 404: The requested record wasn't found.

Restore an archived employee

To restore an employee, you need to send a request to edit employee and add the is_deleted: false flag.